package com.bobo.netty.server.controller;

import com.bobo.netty.base.ResponseResult;
import com.bobo.netty.service.UserService;
import com.bobo.netty.vo.UserVO;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class IndexController {
    @Resource
    private UserService userService;
    @RequestMapping("/index")
    public String index(Model model){
        ResponseResult<List<UserVO>> allUser = userService.getAllUser(null);
        model.addAttribute("userlist",allUser.getData());
        return "WebsocketChatClient";
    }
}
